import Vue from 'vue'
import Vuex from 'vuex'
import a from './modules/moduleA'
let modules = {
 a
}
const debug = process.env.NODE_ENV !== 'production'
import createLogger from 'vuex/dist/logger'
Vue.config.debug = debug;
Vue.use(Vuex)
let state = {
  hehe:1
}
let mutations = {
  setHeHe(state,data){
    state.hehe=data
  }
}
let actions = {
  setHeHe({commit},data){
    commit('setHeHe',data)
  }
}
let getters = {
  getHeHe(state){
    return state.hehe
  }
}
Object.keys(modules).forEach((key)=>{
  modules[key].namespaced = true;
})
console.log(modules)
const store = new Vuex.Store({
  modules,
  state,
  actions,
  getters,
  mutations,
  strict: debug,
  plugins: debug ? [createLogger()] : []
})
console.log(store)
export default store;